package com.sumainfor.pc.market.controller.gmio;

import com.sumainfor.common.util.FieldCheckUtil;
import com.sumainfor.common.util.JsonResult;
import com.sumainfor.common.utlis.Pager;
import com.sumainfor.pc.market.service.gmio.OwnerBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 功能描述:
 *
 * @Auther: zhlu
 * @Date: 2019/3/31 16:22
 * @Description:
 */
@RestController
@RequestMapping("/key/owner")
public class OwnerBillController {

    @Autowired
    OwnerBillService OwnerBillService;

    /**
     * 功能描述: 
     * 根据业主手机号获取业主所有账单总数
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/3/31 16:25
     */
    @GetMapping("/getOwnerBillList")
    public JsonResult getOwnerBillList(@RequestParam Map<String,Object> params){
        JsonResult result=new JsonResult();
        if(!FieldCheckUtil.isMapFieldNotNull(params,new String[]{"OwPhone"})){
            result.putFailed("OwPhone不能为空！");
            return  result;
        }
        params.put("OwState","5");
        result.put(OwnerBillService.getOwnerBillList(params));
        return result;
    }

}
